package com.wzw.expression.controller;

import com.wzw.expression.record.annotations.IRecord;
import com.wzw.expression.record.annotations.IRecords;
import com.wzw.expression.record.interceptors.DefaultRecordInterceptor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wangzhiwen
 */
@RestController
@RequestMapping("/record")
public class IRecordController {

    @IRecord
            (
                    module = "CRM",
                    submodule = "线索",
                    content = "创建线索数据",
                    serial = "0001",
                    extra = "#{T(com.wzw.expression.record.model.DefaultRecord).createClue(1)}",
                    interceptor = DefaultRecordInterceptor.class
            )
    @PostMapping("/test")
    public String test1(@RequestParam Long companyId) {
        return "success";
    }

    @IRecords(
            value = {
                    @IRecord
                            (
                                    module = "CRM",
                                    submodule = "线索",
                                    content = "创建线索数据",
                                    serial = "0001",
                                    extra = "#{T(com.wzw.expression.record.model.DefaultRecord).createClue(1)}",
                                    interceptor = DefaultRecordInterceptor.class
                            ),
                    @IRecord
                            (
                                    module = "CRM",
                                    submodule = "客户",
                                    content = "创建客户数据",
                                    serial = "0002",
                                    extra = "#{T(com.wzw.expression.record.model.DefaultRecord).createClue(2)}",
                                    interceptor = DefaultRecordInterceptor.class
                            )
            }
    )
    @PostMapping("/test2")
    public String test2(@RequestParam Long companyId) {
        return "success";
    }

}
